<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>供应商平台</title>
</head>
<body class="tob-wrap">
	<div th:replace="common/top"></div>
	<article class="container container-c10-search clearfix">
		<div th:replace="common/left::c_side"></div>
		 <section class="content">

        <h3 class="m-top-bar">
           <!-- <img src="../../images/temp/pic_30x30_01.jpg" alt=""/>
            <a href="#">HUAWEI Tech <icon class="icon-btn icon-btn-blue-close"></icon>
            </a>-->
        </h3>
        <div class="m-order-info-search">
            <div class="m-forms">
                <form id="form_enterprise" action="" method="post">
                    <div class="ul-wrap">
                        <ul class="clearfix">
                            <li>
                                <label for="">甲方Business ID : </label>
                                <select class="select select-w140" name="businessId" id="businessId" onchange="javascript:changeSupplyerOrder(this,7)">
                                    <option value="0">请选择</option>
                        		    <option  th:each="company : ${companys}" th:text="${company.businessId}"></option>
                                </select>
                            </li>
                            <li>
                                <label for="">状态（潜在）: </label>
                                <select class="select select-w140" name="status" id="status" onchange="javascript:changeSupplyerOrder(this,9)">
                                   <option value="0">请选择</option>
                                   <!--<option th:each="purchaseOrder : ${purchaseOrderList}" th:value="${purchaseOrder.tVendor.status}" th:text="#{status+${purchaseOrder.tVendor.status}}">
                                   </option>-->
                        		   <option value="1">待审核</option>
                        		   <option value="2">潜在供应商</option>
                        		   <option value="3">有效供应商</option>
                        		   <option value="4">黑名单</option>
                        		   <option value="0">全部</option>
                                </select>
                            </li>
                            <li>
                                <label for="">等级 : </label>
                                <select class="select select-w140" name="grade" id="grade" onchange="javascript:changeSupplyerOrder(this,8)">
                                    <option value="0">请选择</option>
                                    <!--<option th:each="purchaseOrder : ${purchaseOrderList}" th:text="${purchaseOrder.tVendor.grade}"></option>-->
                        		    <option value="A">A</option>
                        		   <option value="B">B</option>
                        		   <option value="C">C</option>
                        		   <option value="D">D</option>
                                </select>
                            </li>
                            <!--<li>
                                <label for="">负责人 : </label>
                                <select class="select select-w140" name="userName" id="userName" onchange="javascript:changeSupplyerOrder(this,7)">
                                   <option value="0">请选择</option>
                        		    <option th:each="purchaseOrder : ${purchaseOrderList}" th:text="${purchaseOrder.tUser.username}"></option>
                                </select>
                            </li>-->
                            <li>
                                <label for="">供应商名称 : </label>
                                <!--<select class="select select-w140" name="" id=""  onchange="javascript:changeSupplyerOrder(this,1)">
                                    <option value="0">请选择</option>
                        		    <option  th:each="purchaseOrder : ${purchaseOrderList}" th:text="${purchaseOrder.tVendor.tSupplier.companyName}"></option>
                                </select>-->
                                <input type="text" class="select select-w140" id="companyNameSelect" onChange="javascript:changeSupplyerName()"/> 
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
        </div>
        
        <div class="m-table-sell">
            <div class="m-table-cont">
                <table width="100%" summay="" cellpadding="0" cellspacing="0" id="purchaseOrderTable" class="purchaseOrderTable" name="purchaseOrderTable">
                    <thead>
                    <tr>
                        <th><input type="checkbox" name="checkall" id="checkall"/> 序号</th>
                        <th>供应商名称</th>
                        <th>年执行订单数量</th>
                        <th>年订单平均评分</th>
                        <th>上年度等级</th>
                        <th>本年度等级</th>
                        <th>申请时间</th>
                        <!--<th style="display:none"/>-->
                        <th style="display:none"/>
                        <th style="display:none"/>
                        <th style="display:none"/>
                        <th>操作</th>                
                    </tr>
                    </thead>
                    <tbody>
                    <tr id="purchaseOrderTr" class="purchaseOrderTr" name="purchaseOrderTr" th:each="vendor,index:${vendors}">
                        <!--<input type="hidden" name="mobilePhone" id="mobilePhone" th:value="${vendor.tUser.mobilePhone}"/>-->
                                             
						<td> <input type="checkbox" name="purchaseOrderIndex" id="purchaseOrderIndex" th:value="${vendor.id}"/>
							<span th:if="${#strings.length(index.count) eq 1}" th:text="${#strings.prepend(index.count,'00')}"/>
                    		<span th:if="${#strings.length(index.count) eq 2}" th:text="${#strings.prepend(index.count,'0')}"/>
                    		<span th:if="${#strings.length(index.count) eq 3}" th:text="${index.count}"/>
							</td>
                        <td class="w150">
                            <p th:text="${vendor.vendorName}"></p>
                        </td>
                        <td th:if="${vendor.tPurchaseOrder ne null}" th:text="${#lists.size(vendor.tPurchaseOrder)}"></td>

                        <!--<td><span th:if="${vendor.tPurchaseOrder.evaluationTotalScore ne null}"  th:text="${vendor.tPurchaseOrder.evaluationTotalScore}"/></td>-->
                        <td th:if="${vendor.tPurchaseOrder ne null}" th:text="${#aggregates.avg(vendor.tPurchaseOrder.![evaluationTotalScore])}"></td>                       
						<td></td>
                        <td th:text="${vendor.grade}"></td>
                        <td th:if="${vendor.gmtCreateTime ne null}" th:text="${#dates.format(vendor.gmtCreateTime, 'yyyy-MM-dd')}"></td>
                        <!--<td style="display:none" th:text="${purchaseOrder.tUser.username}"/>-->
                        <td style="display:none" th:text="${vendor.tClient.businessId}"/>
                        <td style="display:none" th:text="${vendor.grade}"/>
                        <td style="display:none" th:text="${vendor.status}"/>
                        <td>
                            <a th:href="@{/client/estimate.htm(vendorID=${vendor.id})}">评级</a>
                            <br/>
                           <!-- <a th:href="@{/client/preSupplierAudit.htm(purchaseOrderID=${purchaseOrder.id})}">审核</a>-->                   
                            <a href="#" onclick="javascript:submitReview();">审核</a>
                            <br/>
                            <a href="#" onclick="javascript:submitMessage();">发送信息</a>
                        </td>            
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </section>
	</article>
</body>

<script data-main="../js/page/b1_supplier" src="../lib/requirejs/require.js"></script>
<script type="text/javascript" src="../lib/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="../js/page/b2_order.js"></script>
<script type="text/javascript">
	$(function() {  
	    $("#checkall").click(function() {  
	    	if(this.checked)
	        {
	        	$("input[name='purchaseOrderIndex']").prop("checked",true);
	        }
	        else
	        {
	        	$("input[name='purchaseOrderIndex']").prop("checked",false);
	        }
	    }); 
	}); 
</script>
</html>